<template>
  <div class="Denglu">
    <dingbu :name = "nameone"></dingbu>
    <van-form @submit="onSubmit">
      <van-field
        v-model="username"
        name="手机号"
        label="手机号"
        placeholder="请输入手机号"
        :rules="[{ required: true, message: '请填写手机号' },{pattern : /^1[3-9]\d{9}$/,message : '手机号格式错误'}]"
      />
      <van-field
        v-model="password"
        type="password"
        name="密码"
        label="密码"
        placeholder="请输入密码"
        :rules="[{ required: true, message: '请填写密码' },{validator:(e)=>/^\w{6,12}$/.test(e),}]"
      />
      <div style="margin: 16px" >
        <van-button round block type="info" native-type="submit"   :color="basecolor"
          >登录</van-button
        >
      </div>
    </van-form>
  </div>
</template>

<script>
import dingbu from '../components/dingbu.vue';
import { login } from "@/api/user.js";


export default {
  components: {
    dingbu
  
  },
  data() {
    return {
      nameone : "登录",
        username: '',
      password: '',
      
    };
    
     },
      methods: {
    onSubmit(values) {
      console.log('submit', values);
    },
      }
     
};
</script>

<style>

</style>